#ifndef ADEPTENGINE_H
#define ADEPTENGINE_H

#include "namegiverengine.h"
#include "../adept.h"

class AdeptEngine : public NameGiverEngine
{
public:
  // The adept's discipline
  static const char* ARG_DISCIPLINE;

  // Probability to raise an already known talent
  static const char* ARG_RAISE_KNOWN_TALENT_PROBABLITY;
  static double ARG_RAISE_KNOWN_TALENT_PROBABLITY_DEFAULT;

  // Probability to learn a new talent
  static const char* ARG_LEARN_NEW_TALENT_PROBABLITY;
  static double ARG_LEARN_NEW_TALENT_PROBABLITY_DEFAULT;

  // Probability to learn a new specialization
  static const char* ARG_LEARN_NEW_SPECIALIZATION_PROBABLITY;
  static double ARG_LEARN_NEW_SPECIALIZATION_PROBABLITY_DEFAULT;

  AdeptEngine();

protected:
  virtual void init(const QVariantMap &args);
  virtual void reset();

  virtual void createBase();

  virtual void refreshLists();
  virtual bool canSpendLegendPoints();
  virtual void spendLegendPoints();

private:
  Adept* _adept;

  double _raiseKnownTalentProbability;
  double _learnNewTalentProbability;
  double _learnNewSpecializationProbability;

  QList<Talent> _unknownTalents;
  QList<Talent> _knownTalents;

  bool canRaiseCircle();

  void learnNewTalent();
  void raiseKnownTalent();
};

#endif // ADEPTENGINE_H
